#pragma once
#include "Types.h"
#include "GL/GL.h"

class BaseObject
{
protected:
	Point Position;
	Color ObjectColor;

	// Model 
	char * p_3dsFileName;
	char name[20];
	int polygon_qty;
	int vertex_qty;
	Point * pVertices;  
	Polygon * pPolygons;
	MapCoordinate * pMapcoord;  //wsp. textur
	//Point * pNormal; 

	// Material
	GLfloat SpecularColor[3];
	GLfloat DiffuseColor[3];
	GLfloat EmissiveColor[3];
	GLfloat Shininess[1];

	char * Texture;
	// Other
	long long int Counter;

public:
	BaseObject(){};
	virtual void Initialise(char* initFile,Color& color,Point& position);
	virtual void Initialise(float x, float y, float z);
	virtual void Initialise(char * initFile);
	virtual void Initialise();
	virtual void Display();
	void LoadObjectMesh();
};

//The HitBox class used in hit tests betwean interactive objects
class HitBox
{
private:
	Point pVertices[4];
	Point currentPosition;
	Point previousPosition;
	char name[20];
public:
	void LoadAndInitialise(char* filename,Point startPosition);
	void moveToPosition(Point& newPosition);
	bool HitTest(HitBox& otherHitBox);
};

//class that represents objects with ability to move , shoot or be destroyed
class InteractiveObject : public BaseObject
{
public:
	int player; //0-enemy
	int health;
	int attackPower;
	bool IsAlive;
	HitBox hitBox;
	bool HitTest(InteractiveObject* otherObject);
	virtual bool Move();
};